package cn.itsource.hrm.web.controller;

import cn.itsource.hrm.doc.CourseDoc;
import cn.itsource.hrm.repositroy.CourseDocRepositroy;
import cn.itsource.hrm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseDocRepositroy docRepositroy;

    /**
     * 把课程搜索信息保存到ES中
     * @param courseDoc
     * @return
     */
    @RequestMapping("/save")
    public AjaxResult save(CourseDoc courseDoc) {
        docRepositroy.save(courseDoc);
        return AjaxResult.me();
    }
}
